import requests
from config import url_cloud,headers_web

class LaboratoryQuestionLibrary:
    def __int__(self):
        self.url = url_cloud
        self.headers = headers_web

    @classmethod
    def post_addLaboratoryQuestion(cls,url_cloud: str,headers= headers_web, params= None, json= None):
        '''
        summary:"新增或更新题库题目"
        description:"1.云课堂管理端"
        :param url_cloud:
        :param headers:
        :param params:
        :param json:
        :return:
        '''
        url = url_cloud + "/teachinglaboratoryapi/v1/laboratoryquestionlibrary"
        r = requests.post(url= url,headers= headers,params= params,json= json)
        return r

    @classmethod
    def post_delLaboratoryQuestion(cls,url_cloud: str,headers= headers_web, params= None, json= None):
        '''
        summary:"批量删除实验室题库题目"
        description:"1.云课堂管理端"
        :param url_cloud:
        :param headers:
        :param params:
        :param json:
        :return:
        '''
        url = url_cloud + "/teachinglaboratoryapi/v1/laboratoryquestionlibrary/del"
        r = requests.post(url=url, headers=headers, params=params, json=json)
        return r

    @classmethod
    def post_laboratoryQuestionlist(cls,url_cloud: str,headers= headers_web, params= None, json= None):
        '''
        summary:获取题库题目
        description:"1.云课堂管理端"
        :param url_cloud:
        :param headers:
        :param params:
        :param json:
        :return:
        '''
        url = url_cloud + "/teachinglaboratoryapi/v1/laboratoryquestionlibrary/laboratoryquestionlibrarylist"
        r = requests.post(url=url, headers=headers, params=params, json=json)
        return r
    @classmethod
    def post_reorderLaboratoryQuestion(cls,url_cloud: str,headers= headers_web, params= None, json= None):
        '''
        summary:实验室题库题目拖动排序
        description:"1.云课堂管理端"
        :param url_cloud:
        :param headers:
        :param params:
        :param json:
        :return:
        '''
        url = url_cloud + "/teachinglaboratoryapi/v1/laboratoryquestionlibrary/reorder"
        r = requests.post(url=url, headers=headers, params=params, json=json)
        return r

    @classmethod
    def get_questioncomplexitys(cls,url_cloud: str,headers= headers_web, params= None):
        '''
        summary:1.获取实验室题库题目难度列表
        description:"1.云课堂管理端"
        :param url_cloud:
        :param headers:
        :param params:
        :param json:
        :return:
        '''
        url = url_cloud + "/teachinglaboratoryapi/v1/laboratoryquestionlibrary/questioncomplexitys"
        r = requests.get(url=url, headers=headers, params=params)
        return r

    @classmethod
    def get_questiontypes(cls,url_cloud: str,headers= headers_web, params= None):
        '''
        summary:1.获取实验室题库题目类型列表
        description:"1.云课堂管理端"
        :param url_cloud:
        :param headers:
        :param params:
        :param json:
        :return:
        '''
        url = url_cloud + "/teachinglaboratoryapi/v1/laboratoryquestionlibrary/questiontypes"
        r = requests.get(url=url, headers=headers, params=params)
        return r